/**
 * 装饰器模式
 */
class Circle {
    draw() {
        console.log('画一个圆');
    }
}

class Decorator {
    constructor(circle) {
        this.circle = circle;
    }
    draw() {
        this.circle.draw();
        this.setRedBorder();
    }
    setRedBorder() {
        console.log('画一个红色边框');
    }
}

// 测试 
let circle = new Circle();
circle.draw();
console.log('--分割线--')
let dec = new Decorator();
dec.draw();